import request from "@/utils/request";

export interface UserData {
  password: string;
  username: string;
}
interface TokenData {
  token: string;
}
export interface UserInfoData {
  routes: string[];
  buttons: string[];
  roles: string[];
  name: string;
  avatar: string;
}
export default {
  // GET / admin / acl / index / info;
  // info;
  reqGetUserInfo() {
    return request.get<any, UserInfoData>("/admin/acl/index/info");
  },
  // POST / admin / acl / index / login;
  // login;
  reqLogin(userData: UserData) {
    return request.post<any, TokenData>("/admin/acl/index/login", userData);
  },
  // POST / admin / acl / index / logout;
  // logout;
  reqLogout() {
    return request.post<any, null>("/admin/acl/index/logout");
  },
};
